import request from '@/utils/request'

// 用户登录
export function login(username, password) {
  return request({
    url: '/api/login',
    method: 'post',
    params: {
      username,
      password
    }
  })
}

// 用户注册
export function register(userData) {
  return request({
    url: '/api/register',
    method: 'post',
    data: userData
  })
}

// 发送邮箱验证码
export function sendVerificationCode(mail) {
  return request({
    url: '/api/mail/send-code',
    method: 'post',
    params: {
      mail
    }
  })
}